import { reactive, onMounted, onBeforeUnmount } from 'vue'
export function savePoint() {
    let point = reactive({
        x: 0,
        y: 0
    })

    function chanePoint(e) {
        point.x = e.pageX
        point.y = e.pageY
    }

    onMounted(() => {
        window.addEventListener('click', chanePoint)
    })

    onBeforeUnmount(() => {
        window.removeEventListener('click', chanePoint)
    })

    return point
}